#include "whaletwitterstreamtab.h"

#include <QLabel>
#include <QVariant>
#include <QString>

#include "whaletweetentry.h"
#include "../logic/whaletwitterconnect.h"

WhaleTwitterStreamTab::WhaleTwitterStreamTab( QString titleText, QWidget * parent ) : WhaleStreamTab( parent ) {
    QLabel * title = new QLabel( titleText );
    title->setStyleSheet( "QLabel { font-weight: bold; margin-left: 10px; }" );
    this->setTitle( title );

    this->mConnector = new WhaleTwitterConnect(); // use one main connector object
    this->addConnector( this->mConnector ); // attach main connector
}

WhaleTwitterConnect * WhaleTwitterStreamTab::connector() {
    return this->mConnector;
}

void WhaleTwitterStreamTab::setConnector( WhaleTwitterConnect * connector ) {
    this->mConnector = connector; // change main connector object
    this->addConnector( this->mConnector );
}

WhaleTweetEntry * WhaleTwitterStreamTab::newEntry( QVariantMap data, QString streamName ) {
    return new WhaleTweetEntry( data ); // by default, use WhaleTweetEntry to display data
}
